import math # Fill the number of samples num_points = 1000 # Calculate the step size step_size = 2 * math.pi / num_points # Initialize the lookup table sine_lookup_table = [] # Generate the sine wave values and fill the lookup table for i in range(num_points): # Calculate the sine value sine_value = math.sin(i * step_size) # Scale the sine value to fit within the 12-bit range (0 to 4095) # for 10bit replace with 511.5 # for 12 bit replace with 2147.5 # for 15 bit 16383.5 scaled_value = int((sine_value + 1) * 16383.5) # Append the scaled value to the lookup table sine_lookup_table.append(scaled_value) # Print the sine wave lookup table print(sine_lookup_table)